﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MMITDomain.Abstract;
using MMITDomain.Entities;

namespace MMITDomain.Concrete
{
 

        public class EFPartnerRepository : IPartnerRepository
    {
        private EFDbContext dbContext = new EFDbContext();
        public IQueryable<Partner> Partners
        {
            get
            {
                return dbContext.Partners;
            }
        }
        public void SavePartner(Partner p)
        {
            if (p.Id == 0)
            {
                dbContext.Partners.Add(p);
            }
           

            dbContext.SaveChanges();
        }

        public Partner GetPartnerById(int PartnerId)
        {
            return dbContext.Partners.Find(PartnerId);
        }

    }
}
